<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/jquery-2.1.1.min.js"></script>
    <script src="/js/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <link rel="stylesheet" href="/js/bootstrap-3.3.7-dist/css/bootstrap.css">
    <script src="/js/bootstrap-table/bootstrap-table.js"></script>
    <link rel="stylesheet" href="/js/bootstrap-table/bootstrap-table.css">
    <script src="/js/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <script type="text/javascript">
        $(function () {
            queryLogList();
        })
        function queryLogList() {
            $("#table").bootstrapTable({
                url:'../log/queryLogList',
                striped: true,  //表格显示条纹，默认为false
                toolbar:'#tb',
                pagination:true,
                pageList:[1,2,3,4,5,6,7,8,9,10],
                pageSize:3,
                checkOnSelect:false,
                sidePagination: 'server', // 设置为服务器端分页(!!!!)
                queryParams: function (params) {
                    // 请求服务器数据时发送的参数，可以在这里添加额外的查询参数，返回false则终止请求
                    return {
                        rows:params.limit, // 每页要显示的数据条数
                        page:(params.offset/params.limit)+1, // 每页显示数据的开始行号
                    }
                },
                columns:[
                    {field:'id',title:'Id',align:'center',valign:'middle'},
                    {field:'phone',title:'手机号',align:'center',valign:'middle'},
                    {field:'logName',title:'描述',align:'center',valign:'middle'},
                    {field:'createTime',title:'时间',align:'center',valign:'middle',formatter:function(value,row,index){
                            return new Date(value).toLocaleDateString().replace(/\//g, "-") + " " + new Date(value).toTimeString().substr(0, 8)
                        }},
                ],
                onLoadSuccess: function(){
                    console.info("加载成功");
                },
                onLoadError: function(){
                    console.info("加载数据失败");
                }
            });
        }
    </script>
</head>
<body>
<table id="table"></table>
</body>
</html>